<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="../common/jspcommon.jsp"%>

<script type="text/javascript">
$(function() {
	$("#uploadPhotoFile").MultiFile( {
		STRING : {
			remove : '删除',
			selected : 'Selecionado: $file',
			denied : '不允许上传 $ext 类型的文件!'
		}
	});
	$('#uploadPhotoButton').click(function() {
		var albumId = $("#upload_photo_album_select").val();
		$('#uploadPhotoButton').unbind("click");
		$("#uploadPhotoForm").ajaxSubmit({
			cache : false,
			success : function(data) {
			if(data=='success'){
				$("#content_detail").load("photoPage.htm?album="+albumId,function(){
					operateTip("photo_upload_tip_success");		
				});
			}
		},
		error : function(err) {
			alert(err);
		}
		});
		return false;
	});

	$("#upload_photo_add_album_button").click(function() {
		$("#upload_photo_add_album").load("albumAdd.htm");
		$("#upload_photo_add_album").show();
	});
});
function uploadPhotoClear() {
	$("#uploadImgBox").empty();
	$(":file").each(function() {
		if ($(this).css("position") == 'absolute') {
			$(this).remove();
		}
	});
	$("#upload_photo_file_num").text("0 个文件上传");
}
</script>
<div class="h_newNews_box">
	<div class="h_newNews_text" id="con_newNews_1" style="display: block;">
		<div class="photosUpload_box">
			<div class="selectUpload">
				<form id="uploadPhotoForm" action="uploadPhotoSave.htm"
					method="post" enctype="multipart/form-data">
					<div style="float: left; height: 30px;">
						选择照片专辑：
						<select name="album" id="upload_photo_album_select">
							<c:forEach items="${albumList}" var="album">
								<option value="${album.identifier}"
									<c:if test="${album.identifier==albumId}">
								SELECTED
							</c:if>>
									<c:out value="${album.name}"></c:out>
								</option>
							</c:forEach>

						</select>
					</div>
					<div style="float: left;">
						<a href="javascript:void(0);" id="upload_photo_add_album_button">创建专辑</a>
					</div>
					<div style="float: left; height: 30px; margin-left: 10px;">
						<input type="file" id="uploadPhotoFile" value="上传照片" class="multi"
							accept="gif|jpg|bmp|png" maxlength="10" />
					</div>
				</form>
			</div>
			<div class="uploadImg">
				<div class="uploadImg_input">

				</div>
				<div class="uploadImg_box">
					<ul id="uploadImgBox">

					</ul>
					<div class="uploadImg_f" id="upload_photo_file_num">
						0 个文件上传
						<!--
							<a href="javascript:void(0);" onclick="uploadPhotoClear()">清空列表</a>
							 -->
					</div>
				</div>
				<div class="clear"></div>
				<div class="h_button w75 mt15" id="uploadPhotoButton"
					style="margin-left: 10px;">
					<strong>上传照片</strong>
				</div>
			</div>
		</div>

	</div>
	<div class="h_newNews_text" id="con_newNews_2">
		fdsfsdf
	</div>
</div>
<div id="upload_photo_add_album" style="display: none;"></div>
